package com.zzyl.controller;

import cn.hutool.db.Page;
import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.NursingService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apiguardian.api.API;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.zzyl.base.ResponseResult.success;

/**
 * 护理模块
 */
@Api(tags = "护理模块")
@RestController
@RequestMapping("/nursing_project")
public class NursingController {

    @Autowired
    private NursingService nursingService;

    /**
     * 分页查询
     * @param name
     * @param pageNum
     * @param pageSize
     * @param status
     * @return
     */
    @GetMapping
    @ApiOperation("分页查询")
    public ResponseResult paginatedQueries(String name,
                                           Integer pageNum,
                                           Integer pageSize,
                                           Integer status) {
        PageResponse pageResponse = nursingService.selectByPage(name, pageNum, pageSize, status);

        return success(pageResponse);
    }
}
